<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<% String path=request.getContextPath()+"/";%>
<html>
<head>
    <base href="<%=path%>">
    <title>Title</title>
    <link href="hplus-master//css/bootstrap.min.css?v=3.3.7" rel="stylesheet"/>
    <link href="hplus-master//css/font-awesome.min.css?v=4.4.0" rel="stylesheet"/>
    <link href="hplus-master/css/animate.css" rel="stylesheet"/>
    <link href="hplus-master/css/style.css?v=4.1.0" rel="stylesheet"/>

</head>
<body style="overflow-x: hidden">
<div style="padding: 10px 10px">
    <form class="form-horizontal" id="addForm">
        <input type="hidden" name="operId" value="${opera.operId}">
        <div class="form-group">
            <label for="moduleName" class="col-sm-2 control-label">模块名称</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" value="${opera.moduleName}" id="moduleName" name="moduleName" placeholder="请输入模块名称">
            </div>
        </div>




        <div class="form-group" style="text-align: center">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" class="btn btn-success save" >保存</button>
                <button type="reset" class="btn btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
</body>
<script src="hplus-master/js/jquery.min.js?v=2.1.4"></script>
<script src="hplus-master/js/bootstrap.min.js?v=3.3.7"></script>
<script src="https://unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.js"></script>
<script src="hplus-master/js/plugins/layer/layer.min.js"></script>
<script src="hplus-master/js/plugins/validate/jquery.validate.min.js"></script>
<script src="hplus-master/js/plugins/validate/messages_zh.min.js"></script>
<script >
    $(function (){




        $(".save").click(function(){

            // 对绑定的规则进行校验，如果校验通过，返回true,否则返回false

                let params = $("#addForm").serialize();
                $.ajax({
                    url: 'opera/save',
                    type: 'post',
                    dataType: 'json',
                    data: params,
                    success: function (ret) {

                        if (ret.code == 200) {
                            layer.msg(ret.msg, function () {
                                parent.close();
                            });

                        }
                        if (ret.code != 200) {
                            layer.msg(ret.msg);
                        }

                    }
                })
            })


    })
</script>
</html>
